package chapter3.pp3_8;

import java.util.Stack;

public class reverse {


    public reverse()
    {

    }
public void zhuanhaun(String a){
    ArrayStack stack = new ArrayStack();
    for (int b = 0;b<a.length();b++){
        stack.push(String.valueOf(a.charAt(b)));
    }
    String result="";
    for (int i = 0;i<a.length();i++){
        result+=stack.pop();

    }
    System.out.println(result);
}
public void change(String a){
        ArrayStack stack = new ArrayStack();
        String[]b=a.split(" ");
        for (int i = 0;i<b.length;i++){
            stack.push(b[i]);
        }
        String result="";
        for (int p=0;p<b.length;p++){
            result+=stack.pop()+" ";
        }
        System.out.println(result);
}


}
